const htmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
module.exports = {
    entry: {
        main: './src/js/main.js',
        a: './src/js/a.js',
        b: './src/js/b.js',
        c: './src/js/c.js'
    },
    output: {
        // path: './dist/js', //webpack3.0
        path: path.resolve(__dirname, 'dist'),
        filename: 'js/[name]-[chunkhash].js',
        publicPath: 'http://mini.eastday.com/'
    },
    plugins: [
        new htmlWebpackPlugin({
            // filename: 'index-[hash].html',
            filename: 'a.html',
            template: 'index-multiple.html',
            inject: false,
            title: 'webpack is a a.html',
            excludeChunks: ['b', 'c']
        // chunks: ['main', 'a']
        }),
        new htmlWebpackPlugin({
            // filename: 'index-[hash].html',
            filename: 'b.html',
            template: 'index-multiple.html',
            inject: false,
            title: 'webpack is a b.html',
            excludeChunks: ['a', 'c']
        // chunks: ['b']
        }),
        new htmlWebpackPlugin({
            // filename: 'index-[hash].html',
            filename: 'c.html',
            template: 'index-multiple.html',
            inject: false,
            title: 'webpack is a c.html',
            excludeChunks: ['a', 'b']
        // chunks: ['c']
        })
    ]
}